// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

// 全局注册全部组件
import oolongComponents from '../src/components';
import locale from '../src/locale/lang/zh-CN';

Vue.config.productionTip = false
Vue.use(oolongComponents, {locale});

/* eslint-disable no-new */
// 开启debug模式
Vue.config.debug = true;

new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: {App}
})

router.beforeEach((to, from, next) => {
  oolongComponents.oolongLoadingBar.start();
  next();
});

router.afterEach((to, from, next) => {
  oolongComponents.oolongLoadingBar.finish();
});
